package com.swh.cloud.biz.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.swh.cloud.biz.dao.IUserDao;
import com.swh.cloud.biz.service.IUserService;
import com.swh.user.domain.UserEntity;

/**
 * User业务处理实现类
 * 
 * @author sangwenhao-桑文豪
 * @date 2016年2月24日 下午10:51:28
 */
@Service
@Transactional
public class UserService implements IUserService {

    @Autowired
    private IUserDao userDao;

    @Override
    public UserEntity getById(Long id) {
	return userDao.getById(id);
    }

    @Override
    public List<UserEntity> getByIds(List<String> ids) {
	return userDao.getByIds(ids);
    }

    @Override
    public UserEntity queryByEntity(UserEntity entity) {
	return userDao.queryByEntity(entity);
    }

    /**
     * 通过联合查询 - 复合查询
     * 
     * @author sangwenhao
     * @date 2016年4月22日
     */
    @Override
    public List<UserEntity> getUserByUnion(Map<String, UserEntity> paraMap) {
	return userDao.getUserByUnion(paraMap);
    }

    @Override
    public List<UserEntity> getUserByUnion2(Map<String, UserEntity> paraMap) {
	return userDao.getUserByUnion2(paraMap);
    }

    public IUserDao getUserDao() {
	return userDao;
    }

    public void setUserDao(IUserDao userDao) {
	this.userDao = userDao;
    }


	@Override
	public boolean save(UserEntity entity) {
		return userDao.save(entity);
	}

	@Override
	public boolean delete(String uuid) {
		return userDao.delete(uuid);
	}

	@Override
	public int update(UserEntity entity) {
		return userDao.update(entity);
	}
}
